package com.myfoon.helper;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;

public class CookieHelper {
    public CookieHelper() {
    }
    
    public String getCookieValue(String name, HttpServletRequest request) {
        Cookie cookies[] = request.getCookies();
        for (int i = 0; i< cookies.length; i++) {
            if (cookies[i].getName().equals(name)) {
                return cookies[i].getValue();
            }
        }
        
        return null;
    }
}
